<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>img</title>
</head>

<body>

    <button>图片1</button>
    <button>图片2</button>
    <br><br>

    <img src="images/27679dad9ea2a00d.jpg">

</body>

<script>
    var an = document.getElementsByTagName('button');
    var img = document.getElementsByTagName('img');

    an[0].onclick = function() {
        img[0].src = 'images/8a05ba5bf343f553.jpg';
    }
    an[1].onclick = function() {
        img[0].src = 'images/27679dad9ea2a00d.jpg';
    }
    console.log("%c ", "background: url(https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1598636371527&di=9fea8b492a1dfc17a9dda6eb9b1374fc&imgtype=0&src=http%3A%2F%2Fhiphotos.baidu.com%2Ffeed%2Fpic%2Fitem%2F42a98226cffc1e174fd389e04690f603728de9f7.jpg) no-repeat center;padding-left:640px;padding-bottom: 242px;")
    console.log('%c ', "background: url(http://img95.699pic.com/photo/40141/0737.gif_wh860.gif) no-repeat center;padding-left:640px;padding-bottom: 242px;")
</script>




</html>